<template>
  <div class="toast">{{ message }}</div>
</template>

<script>
  export default {
    data() {
      return {
        message: '',
        duration: 1000,
      };
    },
    mounted() {
      setTimeout(() => {
        this.$el.parentNode.removeChild(this.$el);
      }, this.duration);
    },
    methods: {},
  };
</script>

<style lang="less" scoped>
  .toast {
    position: fixed;
    top: 50%;
    left: 50%;
    background: #343434;
    border-radius: 1rem;
    color: #fff;
    padding: 2rem;
    min-width: 20rem;
    min-height: 10rem;
    z-index: 111111;
    font-size: 2.8rem;
    text-align: center;
    line-height: 1.5;
    width: 40rem;
    margin-left: -20rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
  }
</style>
